]> dgit.raspbian.org Git - gnome-shell.git/commit
st/theme-context: Run dispose on theme nodes on theme context changes
authorJonas Dreßler <verdre@v0yd.nl>
Thu, 24 Jul 2025 16:27:29 +0000 (18:27 +0200)
committerMarge Bot <marge-bot@gnome.org>
Sat, 30 Aug 2025 21:40:30 +0000 (21:40 +0000)
commit41758311d1df0f40ae969b8d57cf3302ad2a5803
treeb16872e980a6ae892f74b53cb743e33de616a092
parent07d6cf017eedfa02059848b33a5412576ac023c6
st/theme-context: Run dispose on theme nodes on theme context changes

When the theme context changes, we clear the theme cache and make the
widget tree throw away and create new theme nodes. That's because the
old theme nodes can no longer be used, they might be referencing old
CSS data, scale factors, or other things.

St itself should never reuse theme nodes after theme context changes,
but of course theme nodes are exposed to users of St, and they can
always keep a theme node around and call a method on it even after a
theme context change.

To avoid those outdated theme nodes accessing outdated pointers into
the Croco structures and causing crashes, force-run their `dispose()`
function when the theme context changes. This should ensure that all
problematic pointers in the theme nodes are cleared, and users of St
can't crash gnome-shell.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3809>
src/st/st-theme-context.c